
const _launchGet = Symbol('_launchGet');
const _onEvent = Symbol('_onEvent');
const _error = Symbol('_error');
export class UtilsGetScene {
    constructor(_options, _callback, _that) {
        if (!_options) return this[_error]('no options?');
        this.options = _options;
        this.sceneKey = [];
        this.callback = _callback;
        this[_launchGet](_that);
        this[_onEvent]();
    }

    [_launchGet](_that) {
        this.options.sceneKey.map(item => {
            _that.scene.launch(item);
            this.sceneKey.push(_that.scene.get(item));
        });
    }

    [_onEvent]() {
        this.options.onEventKey.map(item => {
            this.sceneKey.map(item2 => {
                item2.events.on(item, (e) => {
                    this.callback(e);
                })
            })
        });
    }

    [_error](err) {
        throw err;
    }
}